Skip to content

test(dx): add client parity tests for Dictation and LLM Gateway - #258

Open
pylrn wants to merge 1 commit into
AssemblyAI:masterfrom
pylrn:test/dx-parity-dictation-llm-gateway
Open

pylrn wants to merge 1 commit into
AssemblyAI:masterfrom
pylrn:test/dx-parity-dictation-llm-gateway

Conversation

@pylrn

@pylrn pylrn commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Description

Extends tests/unit/test_dx.py to cover the developer-experience (DX) conventions for the newly added DictationTranscriber, AsyncDictationTranscriber, LLMGateway, and AsyncLLMGateway clients:

  1. api_key= construction:
    • DictationTranscriber and LLMGateway accept an explicit api_key= without a global key set.
    • AsyncDictationTranscriber and AsyncLLMGateway accept api_key=, manage their own client, and clean it up via aclose().
  2. api_key= precedence over caller-provided client:
    • Parametrizes all sync clients (Transcriber, SyncTranscriber, DictationTranscriber, LLMGateway) to verify that passing api_key= derives a new client while leaving the caller's client untouched.
    • Parametrizes all async clients (AsyncTranscriber, AsyncSyncTranscriber, AsyncDictationTranscriber, AsyncLLMGateway) to verify the same precedence, ownership flag, and cleanup semantics.
  3. **Async client ownership semantics (aclose())**:
    • Verifies that passing a pre-existing AsyncClient without api_key= leaves that client open when aclose() is invoked across AsyncTranscriber, AsyncSyncTranscriber, AsyncDictationTranscriber, and AsyncLLMGateway.
  4. Config type guards:
    • Verifies cross-product config rejections (DictationTranscriber rejecting TranscriptionConfig and SyncTranscriptionConfig, and prerecorded / sync transcribers rejecting DictationConfig) with descriptive type error messages.
  5. Version bump:
    • Increments __version__ to 1.6.1 to satisfy CI version bump check.

Validation

  • All 81 tests in tests/unit/test_dx.py pass.
  • Entire test suite (pytest tests/unit) passes: 734 passed.

@ccampbell-aai ccampbell-aai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pylrn! Parity tests are useful. A few changes:

  • Drop the version bump. Test-only PRs get the skip-version-bump label instead
  • Remove the tests that duplicate existing ones. test_dictation.py already covers the api_key constructor and rejecting a sync config, and test_llm_gateway_async.py covers the async gateway cases.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants